home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / swingall.jar / javax / swing / tree / DefaultMutableTreeNode$PostorderEnumeration.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-07-15  |  1.1 KB  |  38 lines

  1. package javax.swing.tree;
  2.  
  3. import java.util.Enumeration;
  4.  
  5. final class DefaultMutableTreeNode$PostorderEnumeration implements Enumeration {
  6.    // $FF: synthetic field
  7.    private final DefaultMutableTreeNode this$0;
  8.    protected TreeNode root;
  9.    protected Enumeration children;
  10.    protected Enumeration subtree;
  11.  
  12.    public DefaultMutableTreeNode$PostorderEnumeration(DefaultMutableTreeNode var1, TreeNode var2) {
  13.       this.this$0 = var1;
  14.       this.root = var2;
  15.       this.children = this.root.children();
  16.       this.subtree = DefaultMutableTreeNode.EMPTY_ENUMERATION;
  17.    }
  18.  
  19.    public boolean hasMoreElements() {
  20.       return this.root != null;
  21.    }
  22.  
  23.    public Object nextElement() {
  24.       Object var1;
  25.       if (this.subtree.hasMoreElements()) {
  26.          var1 = this.subtree.nextElement();
  27.       } else if (this.children.hasMoreElements()) {
  28.          this.subtree = new DefaultMutableTreeNode$PostorderEnumeration(this.this$0, (TreeNode)this.children.nextElement());
  29.          var1 = this.subtree.nextElement();
  30.       } else {
  31.          var1 = this.root;
  32.          this.root = null;
  33.       }
  34.  
  35.       return var1;
  36.    }
  37. }
  38.